package com.mz.ozy.mvp.presenter;


import android.app.Activity;

import com.mz.ozy.base.BasePresenterImpl;
import com.mz.ozy.bean.WpkDetailBean;
import com.mz.ozy.mvp.model.WpkDetailModel;
import com.mz.ozy.mvp.view.WpkDetailContract;
import com.mz.ozy.net.MyObserver;
import com.mz.ozy.utils.RxUtil;

import okhttp3.ResponseBody;

/**
 * Created by administrator on 2018/12/3.
 */
public class WpkDetailPresenter extends BasePresenterImpl<WpkDetailContract.View> implements WpkDetailContract.Presenter{

    private WpkDetailModel mModel;

    public WpkDetailPresenter(){
        mModel = new WpkDetailModel();
    }



    @Override
    public void getWpkDetail(Activity activity, String pageNo) {
        mModel.getWpkDetail(activity,pageNo)
                .compose(RxUtil.rxSchedulerHelper(mView.<ResponseBody>bindToLifecycle()))
                .subscribe(new MyObserver<WpkDetailBean>(mView,false){
                    @Override
                    public void onSuccesss(WpkDetailBean bean) {
                        mView.getWpkDetailSuccess(bean);
                    }
                });
    }
}
